//
//  BaseModel.m
//  UI23--基类
//
//  Created by dllo on 16/1/14.
//  Copyright © 2016年 LANOU3G. All rights reserved.
//

#import "BaseModel.h"

@implementation BaseModel

- (instancetype)initWithDic:(NSDictionary *)dic{
    
    self = [super init];
    if (self) {
        [self setValuesForKeysWithDictionary:dic];
    }
    return self;
}


+ (instancetype)ModelWithDic:(NSDictionary *)dic{
    
    return [[[[self class] alloc] initWithDic:dic] autorelease];
}


+ (NSMutableArray *)ModelHandleWithArray:(NSArray *)arr{
    
    NSMutableArray *arrModel = [NSMutableArray array];
    
    for (NSDictionary *dic in arr) {
       id model = [[self class] ModelWithDic:dic];
        
        [arrModel addObject:model];
    }
    
    return arrModel;
    
    
}



- (void)setValue:(id)value forUndefinedKey:(NSString *)key{
    
}

- (id)valueForUndefinedKey:(NSString *)key{
    return nil;
}



@end
